package com.paad.todolist;

import java.text.SimpleDateFormat;
import java.util.Date;

public class ShoppinglistEntity {

  Integer id = null; 
  String name;
  Date date;
  
  public Integer getId() {
	return id;
  }
  
  public String getName() {
    return name;
  }
  
  public Date getCreated() {
    return date;    
  }
  
  public ShoppinglistEntity(Integer _id, String _name, Date _created) {
	id = _id;
	name = _name;
    date = _created;
  }
  
  public ShoppinglistEntity(String _name){
	  name = _name;
	  date = new Date();
	  //date = new Date(java.lang.System.currentTimeMillis());
  }
  

  public void setId(Integer _id) {
	id = _id;
  }
  
  @Override
  public String toString() {
    SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yy");
    String dateString = sdf.format(date);  
    return "(" + dateString +  ") " + name; 
  }
}